home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 00 / 5 / DISK0052.ZIP / PR256.ASM < prev    next >
Assembly Source File  |  1983-03-29  |  27KB  |  759 lines

  1.  
  2.  Command ? re pr256.asm
  3.  
  4. PAGE
  5. PAGE 64,132
  6. ;
  7. ;
  8. TITLE PR256 - IBM CHAR SET FOR MX100 by Tim Field
  9. ;***********************************************
  10. ;
  11. ;PR256...Copyright by Tim Field, 1982
  12. ;
  13. ;IBM CHARACTER SET - This program resides on the IBM personal
  14. ;  computer. All 256 of the characters used by the IBM will
  15. ;  be available to be printed out using the MX100 or MX80 with
  16. ;  graphics option. The nonstandard characters are printed
  17. ;  automatically by any process or program executing the IBM
  18. ;  interrupt #17H (normal print routine in BIOS).
  19. ;
  20. ;************************************************
  21.  
  22.  
  23. ;************************************
  24. ;
  25. ; DEFINE CONSTANTS USED BY PROGRAM
  26. ;
  27. ;************************************
  28.  
  29.  
  30.  
  31. INTADDR        EQU    7H * 4    ;Address of interrupt vector addr
  32. NEWINT        EQU    027H        ;DOS interrupt code for "End but stay resident"
  33. ESC_CHAR    EQU    1BH        ;ASCII escape character
  34. NUL        EQU    0        ;ASCII NUL character
  35.  
  36. ;
  37. ;Define mask bytes used to turn on and off SYS_MODE for each printer
  38. ;
  39. MASK$BIT_GRAF    EQU    11111110B    ;Printer in bit graphics mode
  40. MASK$SEC_BITG    EQU    11111101B    ;Next char is 2nd graf char count
  41. MASK$FST_BITG    EQU    11111011B    ;Next char is 1st graf char count
  42. MASK$NEW_INTL    EQU    11110111B    ;Next char international char defn
  43. MASK$ESC_SING    EQU    11101111B    ;Expect one more control char
  44. MASK$ESC_NULL    EQU    11011111B    ;Expect control char until NULL found
  45. MASK$ESC_C    EQU    10111111B    ;One more control char if non-zero, else 2 more
  46. MASK$PREV_ESC    EQU    01111111B    ;Next char is escape defn char
  47.  
  48. ;
  49. ;Define structure used to hold each of the three possibly existing
  50. ;printers.
  51. ;
  52. PRINTERS STRUC
  53.     SYS_MODE    DB    0    ;Stores bits pertaining to current printer mode
  54.     GRAF_CNT    DW    0    ;16 bit count of grf chars....for bit-graf mode
  55.     FULL_INSTR    DB    0    ;<0 :CR/LF mode, >0: no control codes, = 0: normal
  56.     GRAF_PRINTER    DB    0    ;=0 Printer has Epson graphisc, <>0: No
  57.     INTLSET        DB    0    ;0-7 value of current international set for Epson
  58. PRINTERS ENDS
  59.     
  60.  
  61.  
  62. ;**********************************
  63. ;
  64. ; Define a temporary stack. Required for initialization
  65. ; of program only
  66. ;    
  67. ;**********************************
  68.  
  69. STACK SEGMENT PARA STACK
  70.     DB    10 DUP('STACK   ')
  71. STACK ENDS
  72.  
  73. ;**********************************
  74. ;
  75. ; Start code area !!
  76. ;
  77. ;**********************************
  78.  
  79. CODE SEGMENT
  80. ASSUME CS:CODE,DS:CODE,SS:STACK,ES:NOTHING
  81.  
  82. PR256 PROC FAR
  83. ;
  84. ; Initialization code...used only once, on system startup
  85. ;
  86. CALL INIT_CODE    ;Call initialization routine
  87. RET        ;Return from initialization
  88.  
  89. ;***********************************
  90. ;
  91. ;Define storage areas here
  92. ;
  93. ;***********************************
  94.  
  95. DWORD_ADDR    DW    0,0        ;Save address to BIOS print routine here
  96. TMPBYTE        DB    9        ;A multiplicand
  97. PR1        PRINTERS <>        ;Set aside area for three printers
  98. PR2        PRINTERS <>        ;
  99. PR3        PRINTERS <>        ;
  100.  
  101. ;************************************
  102. ;Start of actual print runtime code
  103. ;************************************
  104.  
  105. START_UP:        ;Start of actual print routine
  106.     PUSH    DS            ;Save segment register
  107.     PUSH    SI            ;
  108.     PUSH    BX            ;
  109.     PUSH    CX            ;
  110.     PUSH    DX            ;
  111.     PUSH    AX            ;
  112.     MOV    BX,CS            ;
  113.     MOV     DS,BX            ;
  114.     CMP    AH,0            ;Is this  to print out a char?    JE    PCHAR            ;Br if yes
  115.     CALL    PR2BYTE            ;Otherwise just print char
  116.     JMP    DONE            ;  and exit
  117.  
  118. PCHAR:
  119.     MOV    BX,OFFSET PR1        ;Now get offset to printer structure
  120.     CMP    DL,0            ;DX contains 0,1,2 for printer number
  121.     JE    T1            ;BR if printer 0
  122.     ADD     BX,5            ;Move to next printer area
  123.     CMP    DL,1            ;Is it printer 1?    JE    T1            ;Br if yes
  124.     ADD     BX,5            ;Offset to printer 2 structure
  125.  
  126. T1:
  127.  
  128.     CMP GRAF_PRINTER[BX],0        ;Are we talking to a printer with Epson graphics?    JNE MORE$TO$COME        ;Send out char if not graphics printer
  129.     MOV CH,SYS_MODE[BX]        ;Get system mode bits
  130.     RCR CH,1            ;BIT_GRAF_MODE?    JNC NOT$BIT$MODE        ;Br if not
  131.     ;
  132.     ;We are in bit-graphics mode...decrement mode count and send character
  133.     ;as is to printer.
  134.     ;
  135.     DEC GRAF_CNT[BX]        ;Decrement count of graphics characters left
  136.     JNZ MORE$TO$COME        ;Are we done with graphics mode?    AND SYS_MODE[BX],MASK$BIT_GRAF  ;If yes, clear bit to indicate done
  137.  
  138. MORE$TO$COME:
  139.  
  140.     JMP SHORT SENDCHAR        ;Send out bit-graf mode character
  141.  
  142. NOT$BIT$MODE:
  143.  
  144.     CMP    FULL_INSTR[BX],1    ;Are we in "Full Instr Set" mode?    JE    TO$CHKCHAR        ;Br if yes...no "control char" check
  145.     JL    NORM_MODE        ;Br if normal mode
  146.     ;
  147.     ;If reach here, we are in CR/LF mode. The only "printer action"
  148.     ;codes expected here are CR (ASCII 13) and LF (ASCII 10).
  149.     ;All other ASCII values are interpreted as characters to be printed.
  150.     ;
  151.     CMP    AL,13            ;Is Carriage Return char?    JE    SENDCHAR        ;Send to printer if yes
  152.     CMP    AL,10            ;Is Line Feed char?    JE    SENDCHAR        ;Send to printer if yes
  153.  
  154. TO$CHKCHAR:
  155.     JMP    CHKCHAR            ;Else print character from character set
  156. NORM_MODE:
  157.     RCR    CH,1            ;SEC_BITG_CNT?    JNC    NOT$SEC            ;Br if no
  158.     ;
  159.     ;If reach here, the current character is the second count value for
  160.     ;the bit-graphics mode. It is the high order byte and must be added
  161.     ;to the low order byte which was the previous character.
  162.     ;
  163.     MOV    (FULL_INSTR-1)[BX],AL        ;Save Graf Cnt
  164.     AND    SYS_MODE[BX],MASK$SEC_BITG    ;Turn off SEC_BITG_CNT bit
  165.     CMP     GRAF_CNT[BX],0            ;Is count equal 0?    JLE    SENDCHAR            ;If yes, don't set Bit-graf mode
  166.     OR    SYS_MODE[BX],NOT MASK$BIT_GRAF    ;Indicate in Bit-graf mode
  167.     JMP    SHORT SENDCHAR            ;Send out count character
  168. NOT$SEC:
  169.  
  170.     RCR    CH,1            ;FST_BITG_CNT?    JNC    NOT$FST            ;Br if not
  171.     ;
  172.     ;If this bit is set, it indicates that the last character printed out
  173.     ;was "Start Bit Graphics mode" indication. The current character is
  174.     ;to be used as the low order byte of the count of bit-graphics characters
  175.     ;to be sent. The next character is the high-order byte for the
  176.     ;count.
  177.     ;
  178.     AND    SYS_MODE[BX],MASK$FST_BITG    ;Turn off FST_BITG_CNT bit
  179.     OR    SYS_MODE[BX],NOT MASK$SEC_BITG    ;Turn on the SEC_BITG_CNT bit
  180.     MOV     GRAF_CNT[BX],AX            ;Save low order count
  181.     JMP    SHORT SENDCHAR            ;Send count to printer
  182.  
  183. NOT$FST:
  184.     RCR    CH,1                ;NEW_INTL?    JNC    NOT$INTL            ;Br if not
  185.     ;
  186.     ;If this bit is set, it indicates that we previously saw request for a
  187.     ;new "International" character set to be used. The current byte is
  188.     ;expected to be a value from 0 to 7 indicating the set to be used. If
  189.     ;an error is found, no set change is accomplished.
  190.     ;
  191.     CMP AL,0                ;Is current character less than 0?    JL    NOT$VALID            ;Br if yes
  192.     CMP    AL,7                ;Is it greater than 7?    JG    NOT$VALID            ;Br if yes
  193.     ;
  194.     ;If reach here,have valid set...update in memory
  195.     ;
  196.     MOV     INTLSET[BX],AL            ;
  197.  
  198. NOT$VALID:
  199.     AND    SYS_MODE[BX],MASK$NEW_INTL    ;Clear NEW_INTL bit
  200.     JMP    SHORT SENDCHAR            ;Send out value to printer
  201.  
  202. NOT$INTL:
  203.     RCR    CH,1                ;ESC_SINGLE mode?    JNC    NOT$ESC_SING            ;Br if not
  204.     AND    SYS_MODE[BX],MASK$ESC_SING    ;Turn off ESC_SINGLE mode
  205.     JMP    SHORT SENDCHAR            ;Send character to printer
  206.  
  207. NOT$ESC_SING:
  208.  
  209.     RCR    CH1S                ;ESC_NULL mode?    JNC    NOT$ESC_NULL            ;Br if not
  210.     CMP    AL,NUL                ;Is this a NULL character?    JNE    SENDCHAR            ;If not, print out character
  211.     AND    SYS_MODE[BX], MASK$ESC_NULL    ;Otherwise turn off ESC_NULL mode first
  212.     JMP    SHORT SENDCHAR            ;
  213.  
  214. NOT$ESC_NULL:
  215.  
  216.     RCR    CH,1                ;ESC_C mode?    JNC    NOT$ESC_C            ;Br if not
  217.     CMP    AL,NUL                ;Is character NUL?    JNE    NOT$NUL                ;Skip next if not
  218.     OR    SYS_MODE[BX],NOT MASK$ESC_SING    ;Expect one more control character
  219.  
  220. NOT$NUL:
  221.  
  222.     AND     SYS_MODE[BX],MASK$ESC_C        ;Turn off ESC_C mode
  223.  
  224. SENDCHAR:        ;Print out current character and return
  225.  
  226.     CALL     PRBYTE                ;Call print routine
  227.     JMP    DONE                ;Go to end
  228.  
  229. NOT$ESC_C:
  230.  
  231.     RCR    CH,1                ;PREV_ESC mode?    JNC    NOT$ESC                ;Br if not
  232.     ;
  233.     ;If PREV_ESC bit is set, it indicates that the last character seen by
  234.     ;this printer was an "Escape" code. We will now look and see if it is
  235.     ;a control code that we need to remember. These are:
  236.     ;    ESC "L" - Puts printer in dual density bit graphics mode
  237.     ;    ESC "K" - Puts printer in single density bit graphics mode
  238.     ;    ESC "R" - Selects an international character set in printer
  239.     ;
  240.     ;
  241.     ;In addition to this codes that we need to remember, we have some
  242.     ;codes which set a temporary mode. These temporary modes are:
  243.     ;
  244.     ;    "ESC_SINGLE" :Expect one more control code. This is to be
  245.     ;              sent to printer.
  246.     ;    "ESC_NULL"   :Expect control codes to continue until a NUL
  247.     ;              character (ASCII 0) is received
  248.     ;    "ESC_C"         :Expect one more control code. If that code is
  249.     ;              an ASCII 0, expect one more after that.
  250.     ;
  251.     ;The escape sequences which set these modes are:
  252.     ;
  253.     ;    ESC "A"    -  ESC_SINGLE mode
  254.     ;    ESC "D"    -  ESC_NULL mode
  255.     ;    ESC "Q" -  ESC_SINGLE mode
  256.     ;    ESC "B"    -  ESC_NULL mode
  257.     ;    ESC "C"    -  ESC_C mode
  258.     ;    ESC "N"    -  ESC_SINGLE mode
  259.     ;
  260.     AND     SYS_MODE[BX],MASK$PREV_ESC    ;Turn off PREV_ESC mode bit
  261.     CMP     AL,"L"                ;CTRL-L?    JE    SET$BIT_GRAF            ;Br if yes
  262.     CMP    AL,"K"                ;CTRL-K?    JNE    ARND$BIT_GRAF            ;Br if not
  263.  
  264. SET$BIT_GRAF:
  265.  
  266.     OR     SYS_MODE[BX],NOT MASK$FST_BITG    ;Indicate that next char is FST_BITG_CNT
  267.     JMP    SHORT SENDCHAR            ;Done, send out
  268.  
  269. ARND$BIT_GRAF:
  270.  
  271.     CMP    AL,'R'                ;CTRL-R?    JNE    NOT$INT                ;Br if not
  272.     OR    SYS_MODE[BX],NOT MASK$NEW_INTL    ;Indicate next char is NEW_INTL bit
  273.     JMP     SHORT SENDCHAR            ;Send out character
  274.  
  275. NOT$INT:
  276.  
  277.     CMP    AL,'A'                ;ESC A?    JE    DO$ESC_SINGLE            ;Br if yes
  278.     CMP    AL,'Q'                ;ESC Q?    JE    DO$ESC_SINGLE            ;Br if yes
  279.     CMP    AL,'N'                ;ESC N?    JNE    NOT$SINGLE            ;Br if not ESC_SINGLE mode
  280.  
  281. DO$ESC_SINGLE:            ;Set ESC_SINGLE mode
  282.  
  283.     OR     SYS_MODE[BX],NOT MASK$ESC_SING    ;
  284.     JMP    SHORT SENDCHAR            ;Print out char
  285.  
  286. NOT$SINGLE:            ;Check for ESC_NULL mode now
  287.  
  288.     CMP    AL,'D'                ;ESC D?    JE    DO$ESC_NULL            ;Br if yes
  289.     CMP    AL,'B'                ;ESC B?    JNE    NOT$NULL            ;Br if not ESC_NULL mode
  290.  
  291. DO$ESC_NULL:            ;Set ESC_NULL mode
  292.  
  293.     OR    SYS_MODE[BX],NOT MASK$ESC_NULL    ;
  294.     JMP     SHORT SENDCHAR            ;Print out char
  295.  
  296. NOT$NULL:            ;Check for ESC_C mode now
  297.  
  298.     CMP    AL,'C'                ;ESC C?    JNE    NOT$ESCC            ;Br if not
  299.     OR    SYS_MODE[BX],NOT MASK$ESC_C    ;Set ESC_C mode bit
  300.  
  301. NOT$ESCC:            ;Do not care what type of char this is...print it
  302.  
  303.     JMP    SHORT SENDCHAR
  304.  
  305. NOT$ESC:            ;Previous character was not an ESCAPE control char
  306.         ;
  307.         ;Is this an ESCAPE code?        ;
  308.  
  309.     CMP    AL,ESC_CHAR            ;
  310.     JNE NESC                ;Br if not
  311.     OR SYS_MODE[BX],NOT MASK$PREV_ESC    ;Set escape found bit
  312.     JMP    SHORT SENDCHAR            ;Send out character
  313.  
  314. NESC:
  315.     ;
  316.     ;See if we have any standard control codes...ASCII 7 - 20
  317.     ;
  318.  
  319.     CMP    AL,07H                ;Is char less than 7?    JL    CHKCHAR                ;Br if yes, not control code
  320.     CMP    AL,14H                ;Is char less than 14H?    JLE    SENDCHAR            ;If not, it is a control code...print it
  321.  
  322. CHKCHAR:
  323.     ;
  324.     ;Here we check to see if the character to be printed is in the range
  325.     ;of 20H to 7EH (ASCII value of the character to be printed.) If in
  326.     ;that range, use standard EPSON character set. Otherwise, we have
  327.     ;a special character to print.
  328.     ;
  329.  
  330.     MOV    AH,0                ;Make sure nothing is in upper byte
  331.     CMP    AX,20H                ;Is character less than 20H?    JL    BIT$CHAR            ;Br if yes, special character
  332.     CMP     AX,7EH                ;
  333.     JLE SENDCHAR                ;Not a special character, just print it
  334.     SUB    AL,7EH-20H+1            ;Subtract non-special character set out
  335.  
  336. BIT$CHAR:
  337.         ;
  338.         ;See if current character is part of the Epson's international character
  339.         ;set (If its offset into BITTYP array is 0, international)
  340.         
  341.     PUSH BX                    ;Save offset to storage area
  342.     PUSH    AX                ;Save current character
  343.     MOV     BX,AX                ;
  344.     MOV    CL,3                ;Shift count
  345.     SHR    BL,CL                ;Shift lower three bits from AL
  346.     MOV    CH,BITTYP[BX]            ;Get byte containing type bit
  347.     SHL    BL,CL                ;Move AL back to original position
  348.     ;Note: we have now lost the three lower bits from AL.
  349.     NEG    BX                ;Take 2's compliment of BL
  350.     ADD BL,AL                ;Add original contents of AL to negated
  351.                         ;  value to get the three bits
  352.     INC BL                    ;This is now our index to type bit
  353.     MOV    CL,BL                ;Let's use value as shift count
  354.     MUL TMPBYTE                ;Offset into array
  355.     MOV    SI,AX                ;Get index into array
  356.     POP    AX                ;Once again, get original character
  357.     SHL    CH,CL                ;Recall CH holds bit-type byte
  358.     JC    DO$BIT_GRAF            ;Carry now is type of the char
  359.     ;
  360.     ;Well, we see that the bit type was 0, so we are to specify a character
  361.     ;from the Epson international character set. To determine which, we
  362.     ;expect the first byte in BITVAL array to tell us which international
  363.     ;set to use and the second byte to tell us the character to print.
  364.     ;
  365.     MOV    CH,BITVAL[SI]            ;Get character set
  366.     CMP    INTLSET[BX],CH            ;Is this the set we are now using?    JNE    NEW$INTSET            ;Br if not
  367.     POP    BX                ;Keep stack clean
  368.     MOV    AL,BITVAL[SI][1]        ;If yes, just send out character
  369.     JMP    SENDCHAR            ;
  370.  
  371. NEW$INTSET:        ;Must temporarily set up new international set
  372.  
  373.     MOV    AL,ESC_CHAR            ;Print out "Esc" char
  374.     CALL    PRBYTE                ;
  375.     MOV    AL,'R'                ;Send out new international signal
  376.     CALL    PRBYTE                ;
  377.     MOV AL,CH                ;Print out character set to use
  378. CALL     PRBYTE                    ;
  379.     MOV    AL,BITVAL[SI][1]        ;Get intl character to print
  380.     CALL    PRBYTE                ;
  381.     MOV    AL,ESC_CHAR            ;Now restore original character set
  382.     CALL    PRBYTE                ;
  383.     MOV    AL,'R'                ;
  384.     CALL     PRBYTE                ;
  385.     POP    BX                ;Restore address to store area
  386.     MOV    AL,INTLSET[BX]            ;Set type
  387.     CALL     PRBYTE                ;
  388.     JMP    DONE                ;We are done so exit program
  389.  
  390. DO$BIT_GRAF:    ;Special bit-graphics mode
  391.  
  392.     POP    BX            ;Restore to keep stack straight
  393.     PUSH    AX                ;Save current character for indexing
  394.     MOV    AL,ESC_CHAR            ;Put printer in dual density bit mode
  395.     CALL     PRBYTE                ;
  396.     MOV    AL,'L'                ;
  397.     CALL     PRBYTE                ;
  398.     MOV    AL,12                ;Each graphics character consists of
  399.     CALL    PRBYTE                ;  exactly nine columns of bits followed
  400.     MOV    AL,0                ;  by 3 blank columns (12 columns total)
  401.     CALL    PRBYTE                ;
  402.     POP    AX
  403.     CMP    AX,0B3H-(7EH-20H+1)        ;See if in extended set
  404.     JL    NON_EXTND            ;Br if not
  405.     CMP    AX,0E0H-(7EH-20H+1)        ;
  406.     JGE    NON_EXTND            ;
  407.         ;
  408.         ;The character is in the "extended" set. (ASCII 176 to 223)
  409.         ;
  410.     MOV     AL,BITVAL[SI]            ;Pre-extend first column
  411.     CALL    PR9BYTS                ;Print out character
  412.     JMP    AROUND                ;Move around non-extended set
  413.  
  414. NON_EXTND:    ;Character is non-extended
  415.  
  416.     MOV    AL,0                ;First column is blank
  417.     CALL     PR9BYTS                ;Print out character
  418.     MOV    AL,0                ;Last two columns are blank
  419.  
  420. AROUND:
  421.  
  422.     CALL     PRBYTE                ;Print out last two columns
  423.     CALL    PRBYTE                ;
  424.  
  425. DONE:        ;Exit program
  426.  
  427.     POP    DX                ;Restore AL without disturbing  AH
  428.     MOV    AL,DL                ;
  429.     POP    DX                ;Restore registers
  430.     POP    CX                ;
  431.     POP    BX                ;
  432.     POP    SI                ;
  433.     POP     DS                ;
  434.     IRET                    ;Return from interrupt
  435.  
  436. PR256 ENDP            ; Done with main routine !!!
  437.  
  438. ;**************************************
  439. ;
  440. ;   PRBYTE - Clears current value AH and prints out character in AL
  441. ;
  442. ;**************************************
  443.  
  444.  
  445. PRBYTE PROC NEAR
  446.  
  447.     MOV     AH,0                ;Clear out for printing w/BIOS
  448.     CALL     PR2BYTE                ;Do actual printing of char
  449.     RET                    ;Done
  450.  
  451. PRBYTE ENDP
  452. ;**************************************************
  453. ;
  454. ;   PR2BYTE - Calls IBM's BIOS print routine to print out contents of AX
  455. ;
  456. ;**************************************************
  457.  
  458. PR2BYTE PROC NEAR
  459.  
  460.     PUSH     DS                ;
  461.     PUSH     SI
  462.     PUSHF                    ;IBM print proc expects interrupt call
  463.     MOV    SI,SEG DWORD_ADDR        ;Get segment to ROM code
  464.     MOV    DS,SI                ;
  465.     MOV    SI,OFFSET DWORD_ADDR        ;Get address to ROM code for print
  466.     CALL     DWORD PTR [SI]            ;Call print routine
  467.     POP     SI
  468.     POP    DS
  469.     RET                    ;Return
  470.  
  471. PR2BYTE ENDP
  472.  
  473. ;********************************************
  474. ;
  475. ;   PR9BYTS - Prints out a graphics character using BITVAL table below.
  476. ;          On entry, AL contains byte value of first column to be printed.
  477. ;          Next nine colums of characters are fetched from indexing thru
  478. ;          SI (which must be initialized by calling routine) into the
  479. ;          BITVAL table.
  480. ;
  481. ;*********************************************
  482.  
  483. PR9BYTS PROC NEAR
  484.  
  485.     CALL PRBYTE                ;Print out first column
  486.     MOV    CX,9                ;Loop through 9 columns
  487.  
  488. LOOP$SEND:
  489.  
  490.     MOV    AL,BITVAL[SI]            ;Get next column to print
  491.     CALL    PRBYTE                ;Print it out
  492.     INC    SI                ;Move to next column
  493.     LOOP    LOOP$SEND            ;Loop until done
  494.     RET                    ;Done, return
  495.  
  496. PR9BYTS ENDP
  497. ;***********************************
  498. ;
  499. ; Define characters...9 bytes per character
  500. ;
  501. ;***********************************
  502. .RADIX 16                ;All values are in hexadecimal
  503. BITVAL DB    000,000,000,000,000,000,000,000,000    ;0 (Decimal ASCII)
  504.     DB    03C,042,089,0A5,085,0A5,089,042,03C    ;1
  505.     DB    03C,07E,093,9BH,0FBH,9BH,093,07E,03C    ;2
  506.     DB    60,0F0,0F8,07C,07E,07C,0F8H,0F0,060    ;3
  507.     DB    000,010,038,07C,0FE,07C,038,010,000    ;4
  508.     DB    010,038,038,0D0,0EE,0D0,038,038,010    ;5
  509.     DB    000,000,030,072,0FE,072,030,000,000    ;6
  510.     DB    000,000,030,078,078,078,030,000,000    ;7
  511.     DB    0FF,0FF,0CF,087,087,087,0CF,0FF,0FF    ;8
  512.     DB    000,018,024,042,042,042,024,018,000    ;9
  513.     DB    0FF,0E7,0DBH,0BDH,0BDH,0BDH,0BH,0E7,0FF    ;10
  514.     DB    000,00C,012,012,012,0B2,0CC,0E0,000    ;11
  515.     DB    000,000,064,094,09F,094,064,000,000    ;12
  516.     DB    000,006,006,0FE,0A0,0A0,0A0,0E0,000    ;13
  517.     DB    006,006,0FE,0A0,0A0,0A0,0AC,0AC,0FC    ;14
  518.     DB    054,010,038,028,0EE,028,038,010,054    ;15
  519.     DB    000,0FE,07C,07C,038,038,010,010,000    ;16
  520.     DB    000,010,010,038,038,07C,07C,0FE,000    ;17
  521.     DB    000,000,028,06C,0FE,06C,028,000,000    ;18
  522.     DB    000,0F2,0F2,000,000,000,0F2,0F2,000    ;19
  523.     DB    060,090,090,0FE,080,080,0FE,080,080    ;20
  524.     DB    001,5DH,000,000,000,000,000,000,000    ;21 * FRANCE -5D
  525.     DB    000,03C,03C,03C,03C,03C,03C,03C,000    ;22
  526.     DB    000,001,029,6DH,0FF,6DH,029,001,000    ;23
  527.     DB    000,000,020,060,0FE,060,020,000,000    ;
  528.     DB    000,000,008,00C,0FE,00C,008,000,000    ;25
  529.     DB    000,010,010,010,010,07C,038,010,000    ;26
  530.     DB    000,010,038,07C,010,010,010,010,000    ;27
  531.     DB    000,000,038,008,008,008,008,000,000    ;28
  532.     DB    010,038,07C,010,010,010,07C,038,010    ;29
  533.     DB    000,004,00C,01C,03C,01C,00C,004,000    ;30
  534.     DB    000,020,030,038,03C,038,030,020,000    ;31
  535.     DB    000,006,00A,012,022,012,00A,006,000    ;127
  536.     DB    001,05C,000,000,000,000,000,000,000    ;128 * FRANCE - 5C
  537.     DB    002,7DH,000,000,000,000,000,000,000    ;129 * GERMANY -7D
  538.     DB    001,7BH,000,000,000,000,000,000,000    ;130 * FRANCE -7B
  539.     DB    005,7DH,000,000,000,000,000,000,000    ;131 * SWEDEN -7D
  540.     DB    002,7BH,000,000,000,000,000,000,000    ;132 * GERMANY -7B
  541.     DB    001,040,000,000,000,000,000,000,000    ;133 * FRANCE -40
  542.     DB    002,007,055,0F5,0B5,0B5,0FE,04F,001    ;134
  543.     DB    000,071,089,089,08F,088,088,050,000    ;135
  544.     DB    000,00E,05F,0D5,095,095,0D5,5DH,00C    ;136
  545.     DB    000,01C,0BE,0AA,02A,02A,0AA,0BA,01B    ;137
  546.     DB    001,7DH,000,000,000,000,000,000,000    ;138 * FRANCE -7D
  547.     DB    000,0A2,0A2,03E,01E,082,082,000,000    ;139
  548.     DB    000,052,0D2,09E,08E,0C2,042,000,000    ;140
  549.     DB    000,012,092,0DE,04E,002,002,000,000    ;141
  550.     DB    002,5BH,000,000,000,000,000,000,000    ;142 * GERMANY -5B
  551.     DB    003,047,04E,0BA,0B2,0BA,04E,047,003    ;143
  552.     DB    005,040,000,000,000,000,000,000,000    ;144 * SWEDEN -40
  553.     DB    004,7BH,000,000,000,000,000,000,000    ;145 * denmark - 7B
  554.     DB    004,5BH,000,000,000,000,000,000,000    ;146 * DENMARK -5B
  555.     DB    000,00E,05F,0D1,091,091,0D1,05F,00E    ;147
  556.     DB    002,07C,000,000,000,000,000,000,000    ;148 * GERMANY -7C
  557.     DB    000,00E,01F,091,0D1,051,011,01F,00E    ;149
  558.     DB    000,05E,0DF,081,081,0C1,05E,01F,001    ;150
  559.     DB    001,07C,000,000,000,000,000,000,000    ;151 * FRANCE -7C
  560.     DB    020,0B0,099,00F,006,00C,098,0B0,020    ;152
  561.     DB    002,05C,000,000,000,000,000,000,000    ;153 * GERMANY 5C
  562.     DB    002,5DH,000,000,000,000,000,000,000    ;154 * GERMANY -5D
  563.     DB    018,03C,066,042,0FF,0FF,042,066,024    ;155
  564.     DB    003,023,000,000,000,000,000,000,000    ;156 * ENGLAND -23
  565.     DB    000,000,094,054,03F,054,094,000,000    ;157
  566.     DB    007,023,000,000,000,000,000,000,000    ;158 * SPAIN -23
  567.     DB    000,004,012,012,07C,090,090,040,000    ;159
  568.     DB    004,00E,02A,06A,0EA,0AA,03C,01E,002    ;160
  569.     DB    000,012,012,05E,0CE,082,002,000,000    ;161
  570.     DB    000,00E,01F,011,051,0D1,091,01F,00E    ;162
  571.     DB    000,01E,01F,041,0C1,081,01E,01F,001    ;163
  572.     DB    007,07C,000,000,000,000,000,000,000    ;164 * SPAIN -7C
  573.     DB    007,05C,000,000,000,000,000,000,000    ;165 * SPAIN -5C
  574.     DB    000,012,0BA,0AA,0AA,0AA,072,07A,00A    ;166
  575.     DB    000,072,0FA,08A,08A,08A,08A,0FA,072    ;167
  576.     DB    007,5DH,000,000,000,000,000,000,000    ;168 * SPAIN -5D
  577.     DB    000,000,038,020,020,020,020,000,000    ;169
  578.     DB    000,000,020,020,020,020,038,000,000    ;170
  579.     DB    000,042,0F4,008,010,029,053,015,009    ;171
  580.     DB    000,042,0F4,008,012,026,04A,01F,002    ;172
  581.     DB    007,5BH,000,000,000,000,000,000,000    ;173 * SPAIN -5B
  582.     DB    010,038,06C,044,010,038,06C,044,000    ;174
  583.     DB    000,044,06C,038,010,044,06C,038,010    ;175
  584.     DB    000,055,000,0AA,000,055,000,0AA,000    ;176
  585.     DB    055,0AA,055,0AA,055,0AA,055,0AA,055    ;177
  586.     DB    0FF,0AA,0FF,055,0FF,0AA,0FF,055,0FF    ;178
  587.     DB    000,000,000,000,0FF,000,000,000,000    ;179
  588.     DB    008,008,008,008,0FF,000,000,000,000    ;180
  589.     DB    028,028,028,028,0FF,000,000,000,000    ;181
  590.     DB    008,008,008,0FF,000,000,0FF,000,000    ;182
  591.     DB    008,008,008,00F,008,008,00F,000,000    ;183
  592.     DB    028,028,028,028,03F,000,000,000,000    ;184
  593.     DB    028,028,028,0EF,000,000,0FF,000,000    ;185
  594.     DB    000,000,000,0FF,000,000,0FF,000,000    ;186
  595.     DB    028,028,028,02F,020,020,03F,000,000    ;187
  596.     DB    028,028,028,0E8,008,008,0F8,000,000    ;188
  597.     DB    008,008,008,0F8,008,008,0F8,000,000    ;189
  598.     DB    028,028,028,028,0F8,000,000,000,000    ;190
  599.     DB    008,008,008,008,00F,000,000,000,000    ;191
  600.     DB    000,000,000,000,0F8,008,008,008,008    ;192
  601.     DB    008,008,008,008,0F8,008,008,008,008    ;193
  602.     DB    008,008,008,008,00F,008,008,008,008    ;194
  603.     DB    000,000,000,000,0FF,008,008,008,008    ;195
  604.     DB    008,008,008,008,008,008,008,008,008    ;196
  605.     DB    008,008,008,008,0FF,008,008,008,008    ;197
  606.     DB    000,000,000,000,0FF,028,028,028,028    ;198
  607.     DB    000,000,000,0FF,000,000,0FF,008,008    ;199
  608.     DB    000,000,000,0F8,008,008,0E8,028,028    ;200
  609.     DB    000,000,000,03F,020,020,02F,028,028    ;201
  610.     DB    028,028,028,0E8,008,008,0E8,028,028    ;202
  611.     DB    028,028,028,02F,020,020,02F,028,028    ;203
  612.     DB    000,000,000,0FF,000,000,0EF,028,028    ;204
  613.     DB    028,028,028,028,028,028,028,028,028    ;205
  614.     DB    028,028,028,0EF,000,000,0EF,028,028    ;206
  615.     DB    028,028,028,0EF,000,000,0EF,028,028    ;207
  616.     DB    008,008,008,0F8,008,008,0F8,008,008    ;208
  617.     DB    028,028,028,028,02F,028,028,028,028    ;209
  618.     DB    008,008,008,00F,008,008,00F,008,008    ;210
  619.     DB    000,000,000,0F8,008,008,0F8,008,008    ;211
  620.     DB    000,000,000,000,0F8,028,028,028,028    ;212
  621.     DB    000,000,000,000,03F,028,028,028,028    ;213
  622.     DB    000,000,000,00F,008,008,00F,008,008    ;214
  623.     DB    008,008,008,0FF,008,008,0FF,008,008    ;215
  624.     DB    028,028,028,028,0FF,028,028,028,028    ;216
  625.     DB    008,008,008,008,0F8,000,000,000,000    ;217
  626.     DB    000,000,000,000,00F,008,008,008,008    ;218
  627.     DB    0FF,0FF,0FF,0FF,0FF,0FF,0FF,0FF,0FF    ;219
  628.     DB    00F,00F,00F,00F,00F,00F,00F,00F,00F    ;220
  629.     DB    0FF,0FF,0FF,0FF,0FF,000,000,000,000    ;221
  630.     DB    000,000,000,000,000,0FF,0FF,0FF,0FF    ;222
  631.     DB    0F0,0F0,0F0,0F0,0F0,0F0,0F0,0F0,0F0    ;223
  632.     DB    000,03C,042,042,042,03C,024,042,000    ;224
  633.     DB    002,07E,000,000,000,000,000,000,000    ;225 * GERMANY -7E
  634.     DB    000,07E,040,040,040,040,040,070,000    ;226
  635.     DB    000,040,07E,040,040,040,07E,040,000    ;227
  636.     DB    082,0C6,0AA,092,082,082,082,0C6,000    ;228
  637.     DB    000,03C,042,042,042,07C,040,040,040    ;229
  638.     DB    000,001,07E,004,004,004,004,078,000    ;230
  639.     DB    000,020,040,040,03E,020,040,040,000    ;231
  640.     DB    000,099,0A5,0A5,0E7,0A5,0A5,099,000    ;232
  641.     DB    000,038,054,092,092,092,054,038,000    ;233
  642.     DB    002,03A,046,080,080,080,046,03A,002    ;234
  643.     DB    000,000,04C,0B2,092,092,08C,000,000    ;235
  644.     DB    038,044,044,044,038,044,044,044,038    ;236
  645.     DB    000,03A,044,04C,054,064,044,0B8,000    ;237
  646.     DB    000,000,038,054,092,082,000,000,000    ;238
  647.     DB     000,01E,020,040,040,040,020,01E,000    ;239
  648.     DB    000,054,054,054,054,054,054,054,000    ;240
  649.     DB    000,022,022,022,0FA,022,022,022,000    ;241
  650.     DB    000,002,08A,08A,052,052,022,022,000    ;242
  651.     DB    000,022,022,052,052,08A,08A,002,000    ;243
  652.     DB    000,000,000,000,07F,080,080,060,000    ;244
  653.     DB    000,006,001,001,0FE,000,000,000,000    ;245
  654.     DB    000,010,010,010,054,010,010,010,000    ;246
  655.     DB    000,024,048,048,024,012,012,024,000    ;247
  656.     DB    000,000,030,048,048,048,030,000,000    ;248
  657.     DB    000,000,030,078,078,078,030,000,000    ;249
  658.     DB    000,000,000,010,038,010,000,000,000    ;250
  659.     DB    010,010,010,008,004,07E,040,040,040    ;251
  660.     DB    080,070,080,080,078,000,000,000,000    ;252
  661.     DB    044,08C,094,064,000,000,000,000,000    ;253
  662.     DB    000,000,07C,07C,07C,07C,07C,000,000    ;254
  663.     DB    000,000,000,000,000,000,000,000,000    ;255
  664.  
  665.  
  666. ;******************************************************
  667. ;    
  668. ;Set up bits to destinguish between normal graphics characters
  669. ;and those which can use the MX100 International character sets
  670. ;
  671. ;*******************************************************
  672.  
  673. .RADIX 10        ;Back do decimal notation
  674.  
  675. BITTYP DB 11111111B    ;ASCII 0 TO 7
  676.     DB 11111111B    ;8 - 15
  677.     DB 11111011B    ;16 - 23
  678.     DB 11111111B    ;24 - 31
  679.     DB 10000001B    ;127 - 134
  680.     DB 11101110B    ;135 - 142
  681.     DB 10001011B    ;143 - 150
  682.     DB 01001010B    ;151 - 158
  683.     DB 11111001B    ;159 - 166
  684.     DB 10111101B    ;167 - 174
  685.     DB 11111111B    ;175 - 182
  686.     DB 11111111B    ;183 - 190
  687.     DB 11111111B    ;191 - 198
  688.     DB 11111111B    ;199 - 206
  689.     DB 11111111B    ;207 - 214
  690.     DB 11111111B    ;215 - 222
  691.     DB 11011111B    ;223 - 230
  692.     DB 11111111B    ;231 - 238
  693.     DB 11111111B    ;239 - 246
  694.     DB 11111111B    ;247 - 254
  695.     DB 10000000B    ;255
  696.  
  697.  
  698.  
  699. LASTONE:     ;All code after this label is freed to DOS use after 
  700.         ;initialization of the program
  701.  
  702. ;******************************************
  703. ;
  704. ;  Code to load and initialize the printing program...
  705. ;  sets up DOS to keep all code before "LASTONE" label
  706. ;  save from overlaying during system operation
  707. ;
  708. ;******************************************
  709.  
  710.  
  711. INIT_CODE PROC NEAR
  712.  
  713.     POP    AX                ;Remove return address of CALL
  714.     ;
  715.     ;After this initialization routine is finished, we wish to return
  716.     ;control to DOS and prevent DOS from overlaying the PR256 code.
  717.     ;This is done by replacing the INT X'20' command found at the front 
  718.     ;of the Program Segment Prefix control block with an INT X'27'
  719.     ;"Program end but stay resident" command. The address to this instruction
  720.     ;is placed on the front of the stack, behind the return address
  721.     ;used by this subroutine. When the initialization is finished, this
  722.     ;routine returns to its caller (the main program) which executes a
  723.     ;return to the FSP, resulting in the INT X'27' command execution.
  724.     ;
  725.     PUSH    DS                ;Move segment address to PSP onto stack
  726.     MOV    DI,0                ;Set return to first location in PSP
  727.     PUSH DI                    ;
  728.     PUSH    AX                ;Restore return address
  729.     MOV    AL,NEWINT            ;Set up INT X'27' in PSP
  730.     MOV    [DI+1],AL            ;
  731.     MOV    AX,0                ;Set up address to INT 17H vector
  732.     MOV    DS,AX                ;
  733.     MOV    BX,INTADDR            ;
  734.     LES    DI,DWORD PTR [BX]        ;Load double word addr to BIOS print rtn.
  735.     MOV    AX,SEG DWORD_ADDR        ;Now set up addr to store BIOS addr
  736.     MOV    DS,AX                ;
  737.     MOV    DWORD_ADDR,DI            ;
  738.     MOV     AX,ES                ;
  739.     MOV    DWORD_ADDR+2,AX            ;Store BIOS print routine address
  740.     MOV    AX,SEG START_UP            ;
  741.     MOV    ES,AX                ;Don't forget to save segment address
  742.     MOV     DI,OFFSET START_UP        ;
  743.     MOV    AX,0                ;
  744.     MOV    DS,AX                ;Now, address back to INT 17H vector
  745.     MOV    BX,INTADDR            ;
  746.     MOV    [BX],DI                ;
  747.     MOV    DI,ES                ;
  748.     MOV    [BX+2],DI            ;
  749.     MOV    DX,OFFSET LASTONE        ;Save all code up to "LASTONE" label
  750.     ADD    DX,0100H            ;  from overlaying by DOS
  751.     RET                    ;Return to main program
  752.  
  753.     INIT_CODE ENDP
  754.     CODE ENDS
  755.     END
  756. 65399 '** DONE - PRESS ENTER TO RETURN TO MENU **
  757. 
  758.  
  759.